<template>
  <div class="all">
<Navbar :navtitle="titles"></Navbar>
<div class="backsd"></div>
       <!-- <div class="zhanghu">
         <p>账户安全</p>
       </div> -->

       <div class="zhanghu">
         <p>基本信息</p>
       </div>
  <div class="bottom-all">
      <div class="shezhi-two" >
           <p>微店名称</p>
           <div >
                <p>{{thistextall.shopName}}</p>
              <img src="../../assets/Fill 1@2.88x.png" alt="" class="img-botom" @click="myshoping">
           </div>
       </div>
        <div class="wei">
      <div class="shezhi-two">
           <p>微店LOGO</p>
           <div class="imgfile-did">
                    <img :src="baselius?baselius:thistextall.logo" alt="" class="img-botom-er">
              <img src="../../assets/Fill 1@2.88x.png" alt=""  class="img-botom" >
                               
                          <div class="imgfile">
                            <van-uploader :after-read="onRead">
                            <van-icon name="photograph" />
                          </van-uploader>
                          </div>
           </div>
       </div>
        </div>
         <div class="wei">
             <div class="shezhi-two">
           <p>微店联系人</p>
           <div>
                 <p>{{thistextall.contactsName}}</p>
              <img src="../../assets/Fill 1@2.88x.png" alt="" class="img-botom" @click="myshopingone">
           </div>
            </div>
       </div>
                <div class="wei">
             <div class="shezhi-two">
           <p>微店联系人电话</p>
           <div>
                 <p>{{thistextall.contactsPhone}}</p>
              <img src="../../assets/Fill 1@2.88x.png" alt="" class="img-botom" @click="myshopingtwo">
           </div>
            </div>
       </div>
       
       <div class="wei">
                      <div class="shezhi-two">
           <p>微店介绍</p>
           <div>
                <p>{{thistextall.remark}}</p>
              <img src="../../assets/Fill 1@2.88x.png" alt="" class="img-botom" @click="myshopingthrss">
           </div>
       </div>
       </div>
        <div class="wei">
             <div class="shezhi-two">
           <p>微店二维码</p>
           <div>
               <p>未开通小程序</p>
              <img src="../../assets/Fill 1@2.88x.png" alt="" class="img-botom">
           </div>
       </div>
       </div>
       </div>
              <div class="zhanghu">
         <p>线上渠道</p>
       </div>
         <div class="bottom-all">
        <div class="wei">
             <div class="shezhi-two">
           <p>是否开通小程序</p>
           <div>
               <p>去开通</p>
              <img src="../../assets/Fill 1@2.88x.png" alt="" class="img-botom">
           </div>
       </div>
       </div>
       </div>


  </div>
</template>

<script>
            //  data = {id:6694,logo:http://b2bbucket-1254060329.picbj.myqcloud.com//img/b9211610d15f42b2846d6e55c2c0e57b.png}
            // url="https://web-gateway.newbeescm.com/ms-web/shopInfoController/updateShopInfoById"   
import { Uploader } from 'vant';
import Navbar from '@/components/Navbar'
import qs from 'qs'
export default {
    components:{
        Navbar,
    },
  data(){
    return{
      titles:"店铺管理",
      thistextall:"",
      baselius:""
    }
  },
  created(){
                 this.$http
        .post(
          "https://web-gateway.newbeescm.com/ms-web/shopInfoController/InsertShopInfoByMerchant",
        qs.stringify(  {
              orgId:this.$store.state.merchantInfo.orgId,
              groupId:this.$store.state.merchantInfo.groupId,
              merchantId:this.$store.state.merchantInfo.merchantId
          }),
          {
            headers: {
              token: this.$store.state.token,
              userId: this.$store.state.userInfo.id
            }
          }
        ).then(res => {
            this.thistextall = res.data.result
          this.$store.commit('woyaomai',res.data.result)
          console.log(res.data.result);
        })
  },
  methods:{
          onRead(file) {
      console.log(file)
       this.baselius  = file.content
       this.$http.post('https://web-gateway.newbeescm.com/ms-web/shopInfoController/updateShopInfoById',{
         id:this.thistextall.id,
         logo:this.baselius
       },{
                     headers: {
              token: this.$store.state.token,
              userId: this.$store.state.userInfo.id
                     }
       }).then(res =>{console.log('成功上传图片',res)})
    },
    yincang(){
          this.$http
        .post(
          "https://web-gateway.newbeescm.com/ms-web/shopInfoController/InsertShopInfoByMerchant",
        qs.stringify(  {
              orgId:this.$store.state.merchantInfo.orgId,
              groupId:this.$store.state.merchantInfo.groupId,
              merchantId:this.$store.state.merchantInfo.merchantId
          }),
          {
            headers: {
              token: this.$store.state.token,
              userId: this.$store.state.userInfo.id
            }
          }
        ).then(res => {
            this.thistextall = res.data.result
          console.log(res.data.result);
        })
    },
    myshopingthrss(){
                   let  tihsalltext = this.thistextall
                this.$router.push({name:"fenyethrss",query:{'contactsName':tihsalltext.contactsName,'contactsPhone':tihsalltext.contactsPhone,'id':tihsalltext.id,'remark':tihsalltext.remark,'shopName':tihsalltext.shopName}})
          
    },
    myshopingone(){
                    let  tihsalltext = this.thistextall
                this.$router.push({name:"fenyeone",query:{'contactsName':tihsalltext.contactsName,'contactsPhone':tihsalltext.contactsPhone,'id':tihsalltext.id,'remark':tihsalltext.remark,'shopName':tihsalltext.shopName}})
           
    },
        myshopingtwo(){
                    let  tihsalltext = this.thistextall
                this.$router.push({name:"fenyetwo",query:{'contactsName':tihsalltext.contactsName,'contactsPhone':tihsalltext.contactsPhone,'id':tihsalltext.id,'remark':tihsalltext.remark,'shopName':tihsalltext.shopName}})
           
    },
            myshoping(){
              let  tihsalltext = this.thistextall
                this.$router.push({name:"fenye",query:{'contactsName':tihsalltext.contactsName,'contactsPhone':tihsalltext.contactsPhone,'id':tihsalltext.id,'remark':tihsalltext.remark,'shopName':tihsalltext.shopName}})
            }
  },
  mounted(){
  }
}

</script>
<style lang="scss" scoped>
.imgfile-did{
  position: relative;
  .imgfile{
     opacity: 0;
  border: 1px solid red;
  width: 0.2rem;
  position: absolute;
  top: 0.11rem;
  right: 0.45rem;
}
}

.backsd{
    position: fixed;
    background: #F1F2F3;
    width: 100%;
    height: 100%;
    z-index: -100;
}
.wei{
  position: relative;
    width: 100%;
  height: 100%;
}
.wei::after{
  content: "";
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  border-bottom: 1px solid  #ccc;
  transform: scale(1,0.1);
}
.bottom-all{
  display: flex;
  flex-direction: column;
  .shezhi-two{
  background: #FFFFFF;
   font-size: 0.14rem;
  height: 0.44rem;
  //margin: 0.1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  p{
    margin-left:0.14rem; 
    color: #666666;
    }
    div{
      display: flex;
      align-items: center;
    
      .img-botom{
        height: 0.15rem;
        transform: rotate(-180deg);
        margin: 0 0.14rem 0 0.15rem;
      }
      .img-botom-er{
          height: 0.38rem;
          width:  0.38rem;
          border-radius:50%; 
      }
    }
}

}
.all{
 // background: rgb(233, 229, 229);
  .zhanghu{
    //  background: #FFFFFF;
         color: #666666;
         margin-bottom: 0.01rem;
 p {  margin-left: 0.14rem;
      height: 0.36rem;
      line-height: 0.36rem;}
  }
}

</style>

